__author__ = "ncll"
__data__ = "2020/11/17 9:31"

# 作业：学生管理系统

# 函数拆包

'''
def my_func(name, age):
    return "姓名" + name, '年龄' + age


my_name, my_age = my_func('cl','18')
print(my_name)
print(my_age)
'''

a, b, c = 1, 2, 4

# 交换
'''a = 4
b = 5
c = 0

c = a
a = b
b = c
print(a, b, c)'''

'''a = 4
b = 5
a = a+b
b = a-b
a = a-b
print(a, b)'''

'''a, b = 4, 5
a, b = b, a
print(a, b)
print(id(a))'''

'''a = ['b', 'c']
# a1 = a.title()   # 首字母大写
print(id(a))
a.append('d')
print(a)
print(id(a))'''

from decimal import Decimal
from decimal import getcontext


'''getcontext().prec = 3  # 设置精度
a = Decimal('4.20')* Decimal('2.10')
print(round(a, 3))

print("%.2f" % c)'''

# 递归函数
''' def my_fuc(a1):
    if a1 > 1:
        return a1 * my_fuc(a1 - 1)
    else:
        return 1

print(my_fuc(4))'''

# 新建一个文件
list1 = [{'姓名': 'c1', '手机号': '11', 'QQ': '111'}, {'姓名': 'c2', '手机号': '544768', 'QQ': '543'}]
f1 = open("1124文件.txt", 'w', encoding='utf-8')
# 使用write()项文件写入内容
i = 0
while i < len(list1):
    f1.write(str(list1[i]))
    i += 1

# 关闭这个文件
f1.close()








